{extend name="default2/shops/base" /}
{block name="title"}审核中的商品-卖家中心{__block__}{/block}
{block name="content"}
<div class="wst-shop-head"><span>审核中商品</span></div>
<div class="wst-shop-tbar">
  <label>
    商品分类：
    <select name="cat1" id="cat1" onchange="getCat(this.value)" class="s-query">
        <option value="">-请选择-</option>
      {volist name=":WSTShopCats(0)" id="vo"}
            <option value="{$vo['catId']}" >{$vo['catName']}</option>
      {/volist}
    </select>
    <select name="cat2" id="cat2" class="s-query"><option value="">-请选择-</option></select>
  </label>
  <label>
    商品名称：<input type="text" name="goodsName" id="goodsName" class="s-query" /><button class="s-btn" onclick="auditByPage()">查询</button>
  </label>
</div>
<div class="wst-clear"></div>
<div class="wst-body"> 
   <div class="s-menu">
      <a href='javascript:;' onclick="changeSale(0,'audit')" class="s-sale"><span>下架</span></a>
      <a href='javascript:void(0);' onclick="changeGoodsStatus('isRecom','audit')" class="s-rec"><span>推荐</span></a>
      <a href='javascript:void(0);' onclick="changeGoodsStatus('isNew','audit')" class="s-new"><span>新品</span></a>
      <a href='javascript:void(0);' onclick="changeGoodsStatus('isBest','audit')" class="s-best"><span>精品</span></a>
      <a href='javascript:void(0);' onclick="changeGoodsStatus('isHot','audit')" class="s-hot"><span>热销</span></a>
      <a href='javascript:void(0);' onclick="benchDel('audit')" class="s-del"><span>删除</span></a>
      <a href='{:url("home/goods/add")}' class="s-add"><span>新增</span></a>
   </div> 
   <div class="wst-clear"></div>
   <table class='wst-list'>
   <thead>
   <tr>
     <th width='10'>
      <div class="checkbox-box-s checkbox-box-s-all">
       <input style="margin-left:2px;" class="wst-checkbox-s" onclick="javascript:WST.checkChks(this,'.chk')" type='checkbox' id="all"/>
       <label for="all"></label>
       </div>
    </th>
     <th>商品名称</th>
     <th>商品编号</th>
     <th>价格</th>
     <th>推荐</th>
     <th>精品</th>
     <th>新品</th>
     <th>热销</th>
     <th>销量</th>
     <th>库存</th>
     <th width="150">操作</th>
   </tr>
   </thead>
   <tbody style="margin-top:15px;" id='list'></tbody>
   <tfoot>
     <tr><td colspan='10' id='pager'></td></tr>
   </tfoot>
   <script id="tblist" type="text/html">
   {{# for(var i = 0; i < d.length; i++){ }}
   <tr>
      <td>
      <div class="checkbox-box-s">
      <input type='checkbox'  class='chk wst-checkbox-s' id="chk-{{i}}" value='{{d[i]['goodsId']}}' /><label for="chk-{{i}}"></label>
      </div>
      </td>
      <td>
        <div class="goods-img">
          <a href="{{WST.U("home/goods/detail","id="+d[i]['goodsId']+"&key="+d[i]['verfiycode'])}}">
            <img class='j-lazyGoodsImg'  data-original='__ROOT__/{{d[i].goodsImg}}'/>
          </a>
        </div>
        <p class="goodsName">
          {{WST.cutStr(d[i]['goodsName'],43)}}
        </p>
          
      </td>
      <td>{{d[i]['goodsSn']}}</td>
      {{# if(d[i]['isSpec']==1) { }}
        <td>￥{{d[i]['shopPrice']}}</td>
      {{# }else{ }}
      <td ondblclick="javascript:toEditGoodsBase(2,{{d[i]['goodsId']}},'')">
          <input id="ipt_2_{{d[i]['goodsId']}}" onkeyup="javascript:WST.isChinese(this,1)" onkeypress="return WST.isNumberdoteKey(event)" onblur="javascript:editGoodsBase(2,{{d[i]['goodsId']}})" style="display:none;width:100%;border:1px solid red;width:40px;" maxlength="10"/>
          <span id="span_2_{{d[i]['goodsId']}}" style="display: inline;cursor:pointer;color:green;">{{d[i]['shopPrice']}}</span>
      </td>
      {{# } }}

  <td><div status="{{d[i]['isRecom']}}" title='双击可修改' ondblclick='changSaleStatus("r",this,{{d[i]["goodsId"]}})' class="w-r {{((d[i]['isRecom']==1)?'right':'wrong')}}"></div></td>
  <td><div status="{{d[i]['isBest']}}" title='双击可修改' ondblclick='changSaleStatus("b",this,{{d[i]["goodsId"]}})' class="w-r {{((d[i]['isBest']==1)?'right':'wrong')}}"></div></td>
  <td><div status="{{d[i]['isNew']}}" title='双击可修改' ondblclick='changSaleStatus("n",this,{{d[i]["goodsId"]}})' class="w-r {{((d[i]['isNew']==1)?'right':'wrong')}}"></div></td>
  <td><div status="{{d[i]['isHot']}}" title='双击可修改' ondblclick='changSaleStatus("h",this,{{d[i]["goodsId"]}})' class="w-r {{((d[i]['isHot']==1)?'right':'wrong')}}"></div></td>

      <td>{{d[i]['saleNum']}}</td>
      {{# if(d[i]['isSpec']==1) { }}
      <td>{{d[i]['goodsStock']}}</td>
      {{# }else{ }}
      <td width="40" ondblclick="javascript:toEditGoodsBase(3,{{d[i]['goodsId']}},'')">
      <input id="ipt_3_{{d[i]['goodsId']}}" onkeyup="javascript:WST.isChinese(this,1)" onkeypress="return WST.isNumberKey(event)" onblur="javascript:editGoodsBase(3,{{d[i]['goodsId']}})" style="display:none;width:100%;border:1px solid red;width:40px;" maxlength="6"/>
      <span id="span_3_{{d[i]['goodsId']}}" style="display: inline;cursor:pointer;color:green;">{{d[i]['goodsStock']}}</span>
      </td>
      {{# } }}
      <td>
         <a class="g-handle" target='_blank' href='{{WST.U("home/goods/detail","id="+d[i]['goodsId']+"&key="+d[i]['verfiycode'])}}'>[查看]</a>
         <a class="g-handle" href='javascript:toEdit({{d[i]['goodsId']}},"audit")'>[编辑]</a>
         <a class="g-handle" href='javascript:del({{d[i]['goodsId']}},"audit")'>[删除]</a>
      </td>
   </tr>
   {{# } }}
   </script>
   </table>
   <div id='pager'></div>
   <div class="s-menu">
      <a href='javascript:;' onclick="changeSale(0,'audit')" class="s-sale"><span>下架</span></a>
      <a href='javascript:void(0);' onclick="changeGoodsStatus('isRecom','audit')" class="s-rec"><span>推荐</span></a>
      <a href='javascript:void(0);' onclick="changeGoodsStatus('isNew','audit')" class="s-new"><span>新品</span></a>
      <a href='javascript:void(0);' onclick="changeGoodsStatus('isBest','audit')" class="s-best"><span>精品</span></a>
      <a href='javascript:void(0);' onclick="changeGoodsStatus('isHot','audit')" class="s-hot"><span>热销</span></a>
      <a href='javascript:void(0);' onclick="benchDel('audit')" class="s-del"><span>删除</span></a>
      <a href='{:url("home/goods/add")}' class="s-add"><span>新增</span></a>
   </div> 
</div>
{/block}  
{block name="js"}
<script type='text/javascript' src='__STYLE__/shops/goods/goods.js?v={$v}'></script>
<script>
$(function(){auditByPage()})
</script>
{/block}